import QtQuick
import QtQuick.Particles

Rectangle {
    width: 400
    height: 400
    color: "black"

    ParticleSystem {
        id: particleSystem
        anchors.fill: parent

        // 粒子绘制器 - 使用图片绘制粒子
        ImageParticle {
            source: "qrc:/images/dot.png"
        }

        // 粒子发射器
        Emitter {
            id: emitter
            system: particleSystem
            height: 1
            width: 1
            anchors.bottom: parent.bottom
            anchors.horizontalCenter: parent.horizontalCenter

            // 发射速率 (每秒粒子数)
            emitRate: 120
            // 粒子生命周期 (毫秒)
            lifeSpan: 2400

            // 粒子大小
            size: 16
            sizeVariation: 16

            velocity: PointDirection {
                y: -150
                yVariation: 50
                x: 0
                xVariation: 100
            }

            acceleration: PointDirection {
                y: 50
            }
        }
    }
}
